Future<String> fetchUsername() {
  return Future.delayed(const Duration(seconds: 2), () => '张三');
}

Future<String> logoutUser() {
  return Future.delayed(const Duration(seconds: 2), () => '张三');
}

// Part 1
addHello(user) {
  return 'Hello $user';
}

// Part 2
// You can call the provided async function fetchUsername()
// to return the username.
Future<String> greetUser() async {
  var user = await fetchUsername();
  return addHello(user);
}

// Part 3
// You can call the provided async function logoutUser()
// to log out the user.
Future<String> sayGoodbye() async {
  try {
    var user = await logoutUser();
    print(user.toString());
    return '$user Thanks, see you next time';
  } catch (err) {
    print(err.toString());
    return err.toString();
  }
}

Future<void> main() async {}
